import scrapy


class TcSpider(scrapy.Spider):
    name = "tc"
    allowed_domains = ["hanzhong.58.com"]
    start_urls = ["https://hanzhong.58.com"]

    def parse(self, response):
        # 获取响应的字符串
        # content = response.text
        # 返回的是二进制数据
        # content = response.body
        content_list = response.xpath('/html/body/div[3]/div[1]/div[1]/div/div[1]/div[1]/h2/a')
        print("============================================")
        print(content_list.extract())
